import React, { Component } from 'react';
import {View, Image, Text} from '@tarojs/components'
import './good-show.scss'

interface Types {
  title: string
  price: number
  markPrice: number
  tips: string
  image: string
  filletedCorner: boolean
}

export default class GoodShow extends Component<Types> {
  static defaultProps = {
    title: '',
    price: 0,
    markPrice: 0,
    tips: '',
    image: '',
    filletedCorner: true,
  }

  render() {
    return (
      <View className='goodShow'>
        <View className={`img-box ${this.props.filletedCorner && 'corner'}`}><Image className='img'
          src={this.props.image}
          mode='widthFix'
        /></View>
        <View className='info-box'>
          <View className='title'>{this.props.title}</View>
          <View className='price-box'>
            <Text className='symbol'>¥</Text><Text className='price'>{this.props.price}</Text><Text> 起 </Text><Text
              className='mark-price'
            >¥{this.props.markPrice}</Text>
          </View>
          <View className='tips'>{this.props.tips}</View>
        </View>
      </View>
    )
  }
}
